class UsersController < ApplicationController
  layout 'main'
    def new
    @user = User.new
    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @user }
    end
    end

    def create
    if params[:user][:password]==params[:confirm]
      @user = User.new(params[:user])
      respond_to do |format|
        if @user.save
          flash[:notice] = 'User was successfully created.'
          format.html { redirect_to(posts_url) }
          format.xml  { render :xml => @user, :status => :created, :location => @user }
        else
          format.html { render :action => "new" }
          format.xml  { render :xml => @user.errors, :status => :unprocessable_entity }
        end
      end
    else
        flash[:notice] = 'Invalid password confirm.'
        redirect_to session[:return_to] || '/users/new'
    end
  end
end
